import request from "@/utils/request";
import { GEN_SERVER } from "@/config/baseUrl";

// 查询当前时间所属生产日期
export function getNowTimeProduceDate(params) {
  return request({
    url:
      GEN_SERVER["produce-server"] +
      "/handover/groupProduceLog/getNowTimeProduceDate",
    method: "get",
    params,
  });
}

// 根据产线、日期查询班组生产工单列表
export function listOrderByLineProduceDate(params) {
  return request({
    url:
      GEN_SERVER["produce-server"] +
      "/handover/order/listOrderByLineProduceDate",
    method: "get",
    params,
  });
}

// 查询工单详情
export function getLineProduceInfo(params) {
  return request({
    url: GEN_SERVER["index-server"] + "/value/line/getLineProduceInfo",
    method: "get",
    params,
  });
}

// 根据工单ID查询生产人员信息
export function getProducingGroupUserByOrderId(params) {
  return request({
    url:
      GEN_SERVER["produce-server"] +
      "/handover/groupProduceLog/getProducingGroupUserByOrderId",
    method: "get",
    params,
  });
}

// 根据时间查询异常统计情况
export function getAbnormalByTime(data) {
  return request({
    url: GEN_SERVER["auxiliary-server"] + "/abnormal/order/summaryByTime",
    method: "post",
    data,
  });
}

// 根据工单ID查询损耗情况
export function getOrderWasteInfo(params) {
  return request({
    url: GEN_SERVER["index-server"] + "/value/line/getOrderWasteInfo",
    method: "get",
    params,
  });
}

// 根据工单ID查询设备停机情况
export function getEquipmentOffInfoByOrderId(params) {
  return request({
    url:
      GEN_SERVER["produce-server"] +
      "/data/equipment/run/getEquipmentOffInfoByOrderId",
    method: "get",
    params,
  });
}

// 根据工单ID+设备停机编码查询设备停机明细
export function getEquipmentOffDetail(params) {
  return request({
    url:
      GEN_SERVER["produce-server"] +
      "/data/equipment/run/getEquipmentOffDetail",
    method: "get",
    params,
  });
}

// 根据工单ID查询设备运行情况
export function getEquipProducingInfo(params) {
  return request({
    url:
      GEN_SERVER["produce-server"] +
      "/data/equipment/run/getEquipProducingInfoByOrderId",
    method: "get",
    params,
  });
}

// 根据工单ID查询工艺参数
export function getKeyProcessParameterByOrderId(params) {
  return request({
    url:
      GEN_SERVER["produce-server"] +
      "/data/equipment/run/getKeyProcessParameterByOrderId",
    method: "get",
    params,
  });
}
